package cn.yl.order.server.entity;

import cn.yl.api.server.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * <p>
 * 支付订单信息表
 * </p>
 *
 * @author yl
 * @since 2022-04-22
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("pay_order")
@ApiModel(value = "PayOrder对象", description = "支付订单信息表")
public class PayOrder  {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long  id;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty("订单号(唯一)")
    @TableField("order_no")
    private String orderNo;

    @ApiModelProperty("用户ID")
    @TableField("user_id")
    private Integer userId;

    @ApiModelProperty("商品唯一标识(ID)")
    @TableField("product_id")
    private Integer productId;

    @ApiModelProperty("产品名称")
    @TableField("product_name")
    private String productName;

    @ApiModelProperty("金额,单位元")
    @TableField("amount")
    private BigDecimal amount;

    @ApiModelProperty("商品数量")
    @TableField("count")
    private Integer count;

    @ApiModelProperty("货币类型，cny-人民币 gbeans-勾豆")
    @TableField("currency")
    private String currency;

    @ApiModelProperty("支付渠道：weChat-微信支付，aliPay-支付宝支付,applePay-苹果支付")
    @TableField("channel")
    private String channel;

    @ApiModelProperty("订单状态：1-未支付 2-支付成功 3-支付失败 -1-订单失效")
    @TableField("status")
    private Integer status;

    @ApiModelProperty("渠道中的状态码值")
    @TableField("channel_status")
    private Integer channelStatus;

    @ApiModelProperty("类型 1-购买课程 2-充值")
    @TableField("order_type")
    private Integer orderType;

    @ApiModelProperty("支付来源 1-app 2-h5 3-pc")
    @TableField("source")
    private Integer source;

    @ApiModelProperty("用户支付IP")
    @TableField("client_ip")
    private String clientIp;

    @ApiModelProperty("购买账号id")
    @TableField("buy_id")
    private String buyId;

    @ApiModelProperty("外部支付渠道交易号")
    @TableField("out_trade_no")
    private String outTradeNo;


    @ApiModelProperty("支付时间")
    @TableField("pay_time")
    private LocalDateTime payTime;

    @ApiModelProperty("附加字段，KV json，例如:{\"mobile\":13020202,\"success_url\":123}")
    @TableField("extra")
    private String extra;

    @ApiModelProperty("商品订单编号")
    @TableField("goods_order_no")
    private String goodsOrderNo;

    @ApiModelProperty("支付所使用的平台：1 拉勾 2 拉勾教育")
    @TableField("platform")
    private Integer platform;

    @ApiModelProperty("微信类型, 参考自lg-wechat-boot项目中的wxinfo")
    @TableField("wx_type")
    private Integer wxType;


}
